package com.common.project.common;

import com.common.project.enums.I18nEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @ClassName ClientParams
 * @Description
 * @Author jiangshicun@bicai365.com
 * @Date 2019/6/20 14:07
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
public class ClientParams {
    private String version;
    private Integer versionNum;
    private String language;
    private String appChannelCode;
    private String platformCode;
    private String appMarketCode;
    private String deviceId;
    private String deviceName;
    private String idfa;
    private String imsi;
    private Integer contentVersion;

    public void setLanguage(String language) {
        I18nEnum[] i18nEnums = I18nEnum.values();
        boolean status = true;
        I18nEnum[] var4 = i18nEnums;
        int var5 = i18nEnums.length;

        for(int var6 = 0; var6 < var5; ++var6) {
            I18nEnum i18nEnum = var4[var6];
            if (i18nEnum.getCode().equalsIgnoreCase(language)) {
                status = false;
                break;
            }
        }

        language = status ? I18nEnum.ZH_CN.getCode() : language;
        this.language = language;
    }


}
